<template>
	<view class="bg-gray1" style="min-height: 100vh;">
		<cu-custom :bgColor="'bg-'+theme.backgroundColor" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">消息列表</block>
		</cu-custom>
		<view class="">
			<view v-for="(item,index) in messageList" :key="index" @click="jumpPage(item.id,item.title)"
				class="flex-row-between bg-white margin padding">
				<view class="flex align-center">
					<image src="../../../static/image/msg.png" mode="" style="width: 120rpx;height: 120rpx;"></image>
					<view class="margin-left-sm">
						<view class="text-black text-bold font-30">{{item.title}}</view>
						<view class="margin-top-sm">
							<text>时间：</text>
							<text>{{item.updateTime}}</text>
						</view>
					</view>
				</view>
				<view class="cuIcon-right"></view>
			</view>
		</view>
	</view>
</template>

<script>
	const util = require("utils/util.js");
	const app = getApp();
	import api from 'utils/api'
	export default {
		data() {
			return {
				CustomBar: this.CustomBar,
				theme: app.globalData.theme, //全局颜色变量
				page: {
					current: 1,
					size: 7,
					status: '1'
				},
				messageList: []
			}
		},

		onLoad(options) {
			app.initPage().then(res => {
				this.messagePage()
			});
		},

		onReachBottom() {

		},

		methods: {
			messagePage() {
				api.messagePage(this.page).then(res => {
					this.messageList = res.data && res.data.records ? res.data.records : []
				});
			},
			jumpPage(id, title) {
				uni.navigateTo({
					url: '/pages/message/msg-info/index?id=' + id + '&title=' + title
				});
			}
		}
	}
</script>

<style>
	.screen-swiper {
		min-height: 280rpx !important;
	}
</style>